//
//  CCEffectDFOutline.h
//  cocos2d-ios
//
//  Created by Oleg Osin on 8/29/14.
//
//

#import "CCEffect.h"

#if CC_EFFECTS_EXPERIMENTAL

/**
 CCEffectDFOutline create an outline around a sprite (combined with a distance field).
 @note This class is currently considered experimental. Set the `CC_EFFECTS_EXPERIMENTAL` macro to 1 in ccConfig.h if you want to use this class.
 */
@interface CCEffectDFOutline : CCEffect

/// -----------------------------------------------------------------------
/// @name Creating an Outline Effect
/// -----------------------------------------------------------------------

/**
 *  Initializes a CCEffectDFOutline object with the supplied parameters.
 *
 *  @param outlineColor Color of the outline, a [CCColor blackColor] will result in an opaque black outline.
 *  @param fillColor Color of the fillColor, a [CCColor blackColor] will result in an opaque black fillColor.
 *  @param outlineWidth pixel width of the outline.
 *  @param fieldScale defined by the distance field generation proccess, for example a distance field that
 *  was generated with a 4096/4096 input and output a 128/128 texture would have a fieldScale of 32 (
 *  input size / output size). Note: this parameter could be automatically calculated if we assume that all
 *  distance fields are generated from a 4096 input.
 *  @param distanceField Distance field texture.
 *
 *  @return The CCEffectDFOutline object.
 *  @since v3.3 and later
 *  @see CCColor
 *  @see CCTexture
 */
+(instancetype)effectWithOutlineColor:(CCColor*)outlineColor fillColor:(CCColor*)fillColor outlineWidth:(int)outlineWidth fieldScale:(float)fieldScale distanceField:(CCTexture*)distanceField;

/**
 *  Initializes a CCEffectDFOutline.
 *
 *  @return The CCEffectDFOutline object.
 *  @since v3.3 and later
 */
-(id)init;

/**
 *  Initializes a CCEffectDFOutline object with the supplied parameters.
 *
 *  @param outlineColor Color of the outline, a [CCColor blackColor] will result in an opaque black outline.
 *  @param fillColor Color of the fillColor, a [CCColor blackColor] will result in an opaque black fillColor.
 *  @param outlineWidth pixel width of the outline.
 *  @param fieldScale defined by the distance field generation proccess, for example a distance field that
 *  was generated with a 4096/4096 input and output a 128/128 texture would have a fieldScale of 32 (
 *  input size / output size). Note: this parameter could be automatically calculated if we assume that all 
 *  distance fields are generated from a 4096 input.
 *  @param distanceField Distance field texture.
 *
 *  @return The CCEffectDFOutline object.
 *  @since v3.3 and later
 *  @see CCColor
 *  @see CCTexture
 */
-(id)initWithOutlineColor:(CCColor*)outlineColor fillColor:(CCColor*)fillColor outlineWidth:(int)outlineWidth fieldScale:(float)fieldScale distanceField:(CCTexture*)distanceField;


/// -----------------------------------------------------------------------
/// @name Outline and Fill Color
/// -----------------------------------------------------------------------

/** Color of the sprite (pass a fillColor with with alpha value of 0.0 to see the actual sprite)
 @since v3.3 and later
 @see CCColor
 */
@property (nonatomic, strong) CCColor* fillColor;

/** Color of the outline
 @since v3.3 and later
 @see CCColor
 */
@property (nonatomic, strong) CCColor* outlineColor;

/** Outline width pixel width of the outline
 @since v3.3 and later
 */
@property (nonatomic) int outlineWidth;

/// -----------------------------------------------------------------------
/// @name Distance Field Texture
/// -----------------------------------------------------------------------

// Distance Field, generated by SDFGen (https://github.com/osinoleg/SDFGen)
@property (nonatomic, strong) CCTexture* distanceField;

@end

#endif
